
import 'package:flutter/services.dart';

class Fluplugin {
  static final MethodChannel methodChannel = MethodChannel('com.lx.methodChannel');
  static final EventChannel eventChannel = EventChannel('com.lx.eventChannel');

  static setMethodCall({required Function(MethodCall) methodCall}){
    methodChannel.setMethodCallHandler((call) => methodCall(call));
  }

  static setEventMsgCall({required Function msgCall}){
    eventChannel.receiveBroadcastStream().listen((event)=>msgCall(event));
  }

  static postMsg(msg){

    methodChannel.invokeMethod('addNum',msg);
  }

}
